package com.ycg.store.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;

/**
 * 盘点差额商品表
 * @TableName inventory_good
 */
@TableName(value ="inventory_good")
@Data
public class InventoryGood implements Serializable {
    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 租户id
     */
    private Integer tenantId;

    /**
     * 货品自增id
     */
    private Integer goodId;

    /**
     * 货品id, 是自定义的id,不是自增的
     */
    private Integer goodNumber;

    /**
     * 调拨货品名称 
     */
    private String goodName;

    /**
     * 盘点类型:盘盈,盘亏
     */
    private String type;

    /**
     * 账面数量
     */
    private Integer shouldNum;

    /**
     * 计量单位
     */
    private String unit;

    /**
     * 账面金额
     */
    private Integer shouldPrice;

    /**
     * 实际数量
     */
    private Integer actualNum;

    /**
     * 实际金额
     */
    private Integer actualPrice;

    /**
     * 账实数量差
     */
    private Integer num;

    /**
     * 账实金额差
     */
    private Integer price;

    /**
     * 原因
     */
    private String comment;

    /**
     * 盘点经手人
     */
    private String manager;

    /**
     * 制表日期
     */
    private LocalDateTime createTime;

    /**
     * 更改日期
     */
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        InventoryGood other = (InventoryGood) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTenantId() == null ? other.getTenantId() == null : this.getTenantId().equals(other.getTenantId()))
            && (this.getGoodId() == null ? other.getGoodId() == null : this.getGoodId().equals(other.getGoodId()))
            && (this.getGoodNumber() == null ? other.getGoodNumber() == null : this.getGoodNumber().equals(other.getGoodNumber()))
            && (this.getGoodName() == null ? other.getGoodName() == null : this.getGoodName().equals(other.getGoodName()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getShouldNum() == null ? other.getShouldNum() == null : this.getShouldNum().equals(other.getShouldNum()))
            && (this.getUnit() == null ? other.getUnit() == null : this.getUnit().equals(other.getUnit()))
            && (this.getShouldPrice() == null ? other.getShouldPrice() == null : this.getShouldPrice().equals(other.getShouldPrice()))
            && (this.getActualNum() == null ? other.getActualNum() == null : this.getActualNum().equals(other.getActualNum()))
            && (this.getActualPrice() == null ? other.getActualPrice() == null : this.getActualPrice().equals(other.getActualPrice()))
            && (this.getNum() == null ? other.getNum() == null : this.getNum().equals(other.getNum()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getComment() == null ? other.getComment() == null : this.getComment().equals(other.getComment()))
            && (this.getManager() == null ? other.getManager() == null : this.getManager().equals(other.getManager()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTenantId() == null) ? 0 : getTenantId().hashCode());
        result = prime * result + ((getGoodId() == null) ? 0 : getGoodId().hashCode());
        result = prime * result + ((getGoodNumber() == null) ? 0 : getGoodNumber().hashCode());
        result = prime * result + ((getGoodName() == null) ? 0 : getGoodName().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getShouldNum() == null) ? 0 : getShouldNum().hashCode());
        result = prime * result + ((getUnit() == null) ? 0 : getUnit().hashCode());
        result = prime * result + ((getShouldPrice() == null) ? 0 : getShouldPrice().hashCode());
        result = prime * result + ((getActualNum() == null) ? 0 : getActualNum().hashCode());
        result = prime * result + ((getActualPrice() == null) ? 0 : getActualPrice().hashCode());
        result = prime * result + ((getNum() == null) ? 0 : getNum().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getComment() == null) ? 0 : getComment().hashCode());
        result = prime * result + ((getManager() == null) ? 0 : getManager().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", tenantId=").append(tenantId);
        sb.append(", goodId=").append(goodId);
        sb.append(", goodNumber=").append(goodNumber);
        sb.append(", goodName=").append(goodName);
        sb.append(", type=").append(type);
        sb.append(", shouldNum=").append(shouldNum);
        sb.append(", unit=").append(unit);
        sb.append(", shouldPrice=").append(shouldPrice);
        sb.append(", actualNum=").append(actualNum);
        sb.append(", actualPrice=").append(actualPrice);
        sb.append(", num=").append(num);
        sb.append(", price=").append(price);
        sb.append(", comment=").append(comment);
        sb.append(", manager=").append(manager);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}